<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>京东(JD.COM)-正品低价、品质保障、配送及时、轻松购物！</title>
<link rel="stylesheet" href="css/jingdong.css">
<link rel="icon" href="favicon.ico">
<script src="./js/jquery.js"></script>
<script src="./js/tools.js"></script>
<script src="./node_modules/layui-layer/dist/layer.js"></script>
</head>
<body>
<div>
<div class="header">
<a class="logo" href="https://www.jd.com"></a>
<span class="wocuol">欢迎登录</span>
<div class="wenjuan"><a href="" class="q-link"><b></b>登录页面，调查问卷</a></div>
</div>
</div>
<div class="tips-wrapper"></div>
<div class="tips-inner">
<div class="cont-wrapper">
<i class="icon-tips"></i>
<p class="qweqwe">依据《网络安全法》，为保障您的账户安全和正常使用，请尽快完成手机号验证！新版<a href="https://about.jd.com/privacy/" class="black" target="_blank">《京东隐私政策》</a>已上线，将更有利于保护您的个人隐私。</p>
</div>
</div>
</div>
<div class="contain">
<div class="login-wrap">
<div class="w">
<div class="login-form">
<div class="tips-wrapper">
<div class="cont-wrapper">
<i class="icon-tips"></i>
<p>京东不会以任何理由要求您转账汇款，谨防诈骗。</p>
</div>
</div>
 <div class="login-tab">账户登录</div>
<div class="msg-wrap">
<div class="msg-error"><b></b>请输入密码</div>
</div>
<div class="form">
<form>
<div class="item-fore1">
<label for="loginname" class="login-label1"></label>
<input  type="text" class="itxt1" name="jdusername"placeholder="邮箱/用户名/登录手机">
<span class="clear-btn"></span> 
</div>
<div class="item-fore2">
<label class="login-label2" for="nloginpwd"></label>
<input type="password"  name="jdpassword" class="itxt2" placeholder="密码">
<span class="clear-btn"></span> 
</div>
<div class="item-fore4">
<div class="safe">
<span></span>
<span class="forget-pw-safe">
<a href="">忘记密码</a>
</span>
</div>
</div>
<div class="item-fore5">
<div class="login-btn">
<button class="btn-img">登录</button>
</div>
</div>
<div class="coagent" id="kbCoagent">
<ul>
<li>
<b></b>
<a href=""class="pdl">
<b class="QQ-icon"></b>
<span>QQ</span>
</a>
<span class="line">&nbsp;&nbsp;|&nbsp;&nbsp;</span>
</li>
<li>
<a href=""class="pdl">
<b class="weixin-icon"></b>
<span>微信</span>
</a>
</li>
<li class="extra-r">
<div>
<div class="regist-link"><a href="./jingdongzhuce.html" target="_blank"><b></b>立即注册</a></div>
</div>
</li>
</ul>
</div>
</form>
</div>
</div>
</div>
<div class="login-banner" style="background-color: #EB764B"></div>
</div>
</div>
<div class="footerbig">
         <div class="link">
         <a href="">关于我们</a> |
         <a href="">联系我们</a> |
         <a href="">人才招聘</a> |
         <a href="">商家入驻</a> |
         <a href="">广告服务</a> |
         <a href="">手机京东</a> |
         <a href="">友情链接</a> |
         <a href="">销售联盟</a> |
         <a href="">京东社区</a> |
         <a href="">京东公益</a> |
         <a href="">English Site</a>
         </div>
         <div class="copyright">
         Copyright©2004-2021&nbsp;&nbsp;京东JD.com&nbsp;版权所有
         </div>
         </div>
</body>
<script>
// 判断是否记住过
var username = tool.getCookie('remusername')
if(username){
    $('[name="jdusername"]').val(username)
}
$('.btn-img').click(function(){
    // 验证表单数据
    // 发送ajax
    $(this).prop('disabled',true)
    var loadindex = layer.load(1,{
        shade:[1,"#000"]
    })
    $.post('./jingdongdenglv.php',$('form').serialize(),res=>{
        layer.close(loadindex)
        // console.log(res);
        var {meta:{status,msg}} = res;
        if(status === 1){
            // 存储登录成功的cookie
            tool.setCookie('username',$('[name="jdusername"]').val(),7200)
            // 判断是否要记住用户名
            if($('[name="remmember"]').prop('checked')){
                tool.setCookie('remusername',$('[name="jdusername"]').val(),7*24*3600)
            }
            layer.msg(msg,{
                icon:1,
                time:1500
            },function(){
                // 检测本地存储中是否存过url - 跳转到url，没有就跳转首页
                var url = localStorage.getItem('url')
                if(url){
                    localStorage.removeItem('url')
                    location.href = url
                    return false;
                }
                location.href = "./index.html";
            })
        }else{
            $(this).prop('disabled',false)
            layer.msg(msg,{
                icon:2,
                time:1500
            })
        }
    },'json')
})
</script>
</html>